package day20171009;

import java.io.*;

public class ReadTxtFile {
    public static void main(String[] args) throws IOException {
        String pathName = "D:\\dev\\poi_ids.txt";

        // 要读取以上路径的JavaTest.txt文件
        File filename = new File(pathName);

        // 建立一个输入流对象reader
        InputStreamReader reader = new InputStreamReader(
                new FileInputStream(filename));


        BufferedReader br = new BufferedReader(reader);

        String line = "";
        line = br.readLine();

        int i = 0;

        while (line != null) {
            i++;
            System.out.println(i+"|"+line);
            line = br.readLine(); // 一次读入一行数据

            if(i == 1002)break;
        }
    }
}
